The present invention relates generally to page layout templates for electronic documents.
Recent advances in network technology, especially in the Internet arena, have produced dramatic increases in the electronic exchange of information. For example, the exchange of electronic documents has become increasingly popular. One key goal in this area is to retain the layout and formatting of electronic documents. To this end, several page layout standards have arisen.
One public domain document page layout standard is Xerox InterScript. Xerox InterScript, the fundamental layout entity is the “box.” A hierarchical tree of boxes forms a layout template. Each box has an associated set of metrics that define its size and its positioning relative to its “sibling” boxes and its “container” box. Boxes are siblings if they exist at the same hierarchical level of the layout template tree and are contained within the same container box. A container box is a box that contains another box. The metrics may be fixed or variable. Variable metrics generally specify a range of permissible values around a nominal value. Thus, variable metrics permit a degree of “stretchability” for a box.
During the Xerox InterScript layout process, new boxes are created and are “poured” into existing boxes. For example, a column box is created to contain a column of text. Then, a line box is created for each line in the column, and the line boxes are poured into the column box. During the Xerox InterScript layout process, the nominal values of the metrics are used. For example, the nominal value for the width of the column box is used for the purposes of text layout.
After the “pouring” phase of an Xerox InterScript layout, certain boxes may have their dimensions “synthesized” as a function of the boxes now contained within them. For example, a column box 204 (FIG. 2) may specify that its final height is to be the sum of the heights of its contained lines 234 (FIG. 2).
Thus, in Xerox InterScript, shrink and stretch adjustments can be made at the end of the layout, after all the document content has been poured into the layout. For example, the lines in the column can be slightly spaced out to fill the column when the column height is not a multiple of the final average line height. This process is referred to as “column justification.”
The mechanism as described by the Xerox InterScript proposal works well when the external bounding box is fixed (for example, the bounding box may be a predefined sheet of paper such as an 8½×11 inch sheet).
FIG. 1 is a block diagram depicting a conventional Xerox InterScript layout process 100. A Xerox InterScript layout engine 106 receives document content 102 and a fixed page layout template 104 and produces a page 108. The page layout template is referred to as a “fixed” template because all of the dimensions of its external bounding box (that is, the bounding box at the top of its page layout hierarchy) are fixed in advance. A fixed page layout template may contain variable metrics at lower layers.
FIG. 2 depicts a conventional fixed page layout template 104. Template 104 has an external bounding box 202 that contains two sibling boxes 204 and 206. Box 202 has a fixed width 208 and a fixed height 210. For convenience, fixed dimensions are depicted as solid line arrows, and variable dimensions are depicted as dashed line arrows. Because template 104 is a fixed template, the dimensions of its external bounding box 202 are fixed. Therefore, dimensions 208 and 210 are shown with solid line arrows. For example, assume template 104 specifies an 8½×11 piece of paper. Then page width 208 is 8½ inches and page height 210 is 11 inches.
Box 204 is a synthesized box having a fixed width 212 and a variable height 218. Template 104 specifies that box 204 is to be a fixed distance 220 from the top of the page, a fixed distance 214 from the left edge of the page, and a fixed distance 216 from the right edge of the page. In addition, template 104 specifies that box 204 is to be a variable distance 222 from its sibling box 206. For our example, box width 212 is 7½ inches and each of margins 214 and 216 are ½ inch. In addition, top margin 220 is one inch. Metric 222 is ½ inch plus or minus ¼ inch.
Box 206 has a fixed width 224 and a variable height 230. Box 206 also has left and right margins 226 and 228, and a bottom margin 232. In our example, box width 224 is six inches and left and right margins 226, 228 are each one inch. In addition, bottom margin 232 is 3/4 of an inch. Box height 230 is synthesized.